<section id="main-content">
  <section class="wrapper">
    <!--state overview end-->
    <div class="row">
      <div class="col-lg-12">
        <section class="panel">
          <header class="panel-heading">
            资产转移历史
          </header>
          <div class="panel-body" style="padding-bottom:0;">
            <div class="row">
              <div class="col-lg-2">
                <div class="input-group m-bot15">
                  <span class="input-group-addon" style="position: relative;z-index: 2;">公司</span>
                  <select class="form-control" style="position: relative;margin-left:-4px;text-indent:2px;" id="company">
                    <option value="" selected>全部公司</option>
                    <option ng-repeat="x in comp" value="{{x.companyId}}">{{x.company}}</option>
                  </select>
                </div>
              </div>
              <div class="col-lg-3">
                <div class="input-group m-bot15">
                  <span class="input-group-addon">资产编号</span>
                  <input type="text" id="assetNo" value="" class="form-control"/>
                </div>
              </div>
              <div class="col-lg-3">
                <button class="btn btn-info pull-left searchs">搜索</button>
              </div>
            </div>
          </div>
          <div class="panel-body">
            <div id="assetsHisContainer" class="dlshouwen-grid-container"></div>
            <div id="assetsHisToolBarContainer" class="dlshouwen-grid-toolbar-container"></div>
          </div>
        </section>
      </div>
    </div>
  </section>
</section>
<script type="text/javascript">
  function findAssetsHis(CertusJsonAjax,CertusFormAjax, $scope) {
      CertusFormAjax.ajax("isCrcd", {
          "code": "ZCLS"
      }, function (response) {
          var data = JSON.parse(response.data);
          CertusFormAjax.ajax("companyListByCode", {
              "code": data.comanyCode
          }, function (response) {
              $scope.comp = JSON.parse(response.data);
          });
      });

      $(".searchs").click(function () {
          // 资产信息记录
          var astlogColumns = [{
              id: 'company',
              title: '所属公司',
              type: 'string',
              width: 100,
              columnClass: 'text-center',
          }, {
              id: 'asset_id',
              title: '资产编号',
              type: 'string',
              width: 200,
              columnClass: 'text-center',
          }, {
              id: 'asset_name',
              title: '资产名称',
              type: 'string',
              width: 160,
              columnClass: 'text-center',
          }, {
              id: 'gsr',
              title: '转移后归属人',
              type: 'string',
              width: 110,
              columnClass: 'text-center',
              resolution: function (value, record) {
                  var content = "";
                  if (record.owerUser!=null&&record.owerUser!=""){
                      content = record.owerUser+"("+record.owerUserId+")";
                  }
                  return content;
              }
          },{
              id: 'action_time',
              title: '操作时间',
              type: 'date',
              width: 100,
              format: 'yyyy-MM-dd hh:mm:ss',
              otype: 'time_stamp_ms',
              columnClass: 'text-center',
          }, {
              id: 'opUser',
              title: '操作人',
              type: 'string',
              width: 75,
              columnClass: 'text-center',
          }, {
              id: 'comments',
              title: '内容',
              type: 'string',
              columnClass: 'text-left',
          }, {
              id: 'rem_desc',
              title: '转移注释',
              type: 'string',
              width: 200,
              columnClass: 'text-left'
          }];

          $("#assetsHisContainer").empty();
          $("#assetsHisToolBarContainer").empty();
          CertusJsonAjax.dataInit("findAssetHistList", {
              "company": $("#company").val(),
              "assetNo": $("#assetNo").val()
          }, astlogColumns, 'assetsHisContainer', 'assetsHisToolBarContainer');
      });

      $(".searchs").click();
  }

</script>